class Solution {
public:
    bool isCovered(vector<vector<int>>& ranges, int left, int right) {
        vector<int> diff(52, 0);
        for(int i = 0; i < ranges.size(); i++){
            diff[ranges[i][0]]++;
            diff[ranges[i][1] + 1]--;
        }
        int ans = 0;
        for(int i = 1; i <= right; i++){
            ans += diff[i];
            if(i >= left && ans < 1)return false;
        }
        return true;
    }
};

//2021.7.23 
